﻿using GenericHtml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WLFramework.Json;

namespace SampleSite.admin.ajax.table
{
    /// <summary>
    /// getall 的摘要说明
    /// </summary>
    public class getall : AjaxHttpHandler
    {
        public override void OnProcessRequest(HttpContext context)
        {
            using (CommandHelper db = new CommandHelper(CommandMethod.Read))
            {
                var query = from p in db.Context.dy_DynamicTables
                            select new
                            {
                                id = p.Id,
                                key = p.TableName,
                                template = p.Template,
                                description = p.Description,
                                state = p.State,
                            };

                context.Response.Write(JSON.Instance.ToJSON(query.ToList()));
            }
        }
    }
}